package com.luxondata.module.masterdata.entry;

import java.util.Date;


import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.luxondata.module.system.entry.User;
/**
 * 经销商主数据
 */
@Entity
@Table(name = "T_BD_Distributor")
public class Distributor {

	private long id;
	private String name; // 名称
	private String number;// 编码
	private User createUser;// 创建人
	private Date createDate;// 创建时间
	private User lastModUser;// 最後修改创建人
	private Date lastModDate;// 创建时间
	private int status;// 状态

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="T_BD_Distributor_SEQ")     
	@SequenceGenerator(name="T_BD_Distributor_SEQ",allocationSize=1,initialValue=1, sequenceName="T_BD_Distributor_SEQ")  
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@Column(name = "fnumber")
	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	@Column(name = "fname")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "create_user_id")
	public User getCreateUser() {
		return createUser;
	}

	public void setCreateUser(User createUser) {
		this.createUser = createUser;
	}

	@Temporal(TemporalType.DATE)
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	@OneToOne(cascade = CascadeType.ALL)
	@JoinColumn(name = "last_mod_user_id")
	public User getLastModUser() {
		return lastModUser;
	}

	public void setLastModUser(User lastModUser) {
		this.lastModUser = lastModUser;
	}

	@Column(name = "last_mod_date")
	@Temporal(TemporalType.DATE)
	public Date getLastModDate() {
		return lastModDate;
	}

	public void setLastModDate(Date lastModDate) {
		this.lastModDate = lastModDate;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

}
